# -*- coding: utf-8 -*-
# @Time    : 2025/6/9 20:44
# @File    : urls.py
# @Software: PyCharm
from tkinter.font import names

from django.urls import path
from polls import views

app_name = "polls"          # 命名空间 重要
urlpatterns = [

    path("", views.index, name="index"),                                # 等价于: /polls/
    path("<int:question_id>/",views.detail, name="detail"),             # 等价于: /polls/5/
    path("<int:question_id>/results/", views.results, name="results"),  # 等价于: /polls/5/results/
    path("<int:question_id>/vote/", views.vote, name="vote"),           # 等价于: /polls/5/vote/
    # 查询所有图书-接口
    path("booksview", views.Booksview.as_view(), name="booksview"),     # 等价于 /polls/booksview
    # 查询一个图书-接口
    path("booksview/<int:pk>", views.Booksdetailview.as_view(), name="booksdetailview"),  # 等价于 /polls/booksview/1
    # 新闻网站用户注册接口
    path("register", views.Register.as_view(), name="register"),        # 等价于 /polls/register
    # 新闻网站用户登录接口
    path("auth", views.Auth.as_view(), name="auth"),                    # 等价于 /polls/auth

]